
//添加条件默认初始数据
export const defalutCondition = {
    boxType: 'single',
    key: '',
    compare: '',
    value: null,
    logic: 'and',
}
// 逻辑关系
export const logicOptions = [
    { label: '且', value: 'and' },
    { label: '或', value: 'or' },
]

const getLabelValue = (arr: any[]) => {
    let tpmArr: { value: any; label: any }[] = []
    arr.forEach((i) => {
        tpmArr.push({
            value: i[0],
            label: i[1],
        })
    })
    return tpmArr
}
// 运算
export const  allCompare = [
    ['lt', '小于'],
    ['lot', '小于等于'],
    ['eq', '等于'],
    ['neq', '不等于'],
    ['gt', '大于'],
    ['got', '大于等于'],
    ['contain', '包含'],
    ['notContain', '不包含'],
]
const commonCompare = [
    ['lt', '小于'],
    ['lot', '小于等于'],
    ['eq', '等于'],
    ['neq', '不等于'],
    ['gt', '大于'],
    ['got', '大于等于'],
]

export const compareKeyMap ={
    'text':getLabelValue([  
        ['eq', '等于'],
        ['neq', '不等于'],
        ['contain', '包含'],
        ['notContain', '不包含'],
    ]),
    'number':getLabelValue(commonCompare),
    'date':getLabelValue(commonCompare),
}

export const keysOptions = [{
    label:'备注',
    value:'remark',
    type:'text'
},
{
    label:'数字',
    value:'count',
    type:'number'
},
{
    label:'日期',
    value:'date',
    type:'date'
}]
